using HCore.Tests.Runtime.ShootingEditor2D.Scripts.Support.CommandQuery;
using HCore.Unity.Behaviour;

namespace HCore.Tests.Runtime.ShootingEditor2D.Scripts.Support
{
    public class HCoreCommandMonoBehaviour : HCoreMonoBehaviour, ICommandSender, IQuerySender
    {
        public void SendCommand(ICommand command)
        {
            PublishEvent(command);
        }

        public T SendQuery<T>(IQuery<T> query)
        {
            PublishEvent(query);
            return query.Result;
        }
    }
}